package com.itgaoshu.hospitalproject.mapper;

import com.itgaoshu.hospitalproject.bean.Type;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TypeMapper {
    //查询所有药品分类的方法
    List<Type> findAllType(String typeName);
    //添加药品分类的方法
    @Insert("insert into type values(null,#{typeName})")
    int addType(Type type);
    //查询这个分类存不存在的方法
    @Select("select count(1) from type where typeName=#{typeName}")
    int count(Type type);
}
